<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>Date添加新函数</title>
		<script>
			var d2=new Date();
			//alert(d2.toChinaFormat());error
			//返回yyyy年mm月dd天 hh时mm分格式
			Date.prototype.toChinaFormat=function(){
				return this.getFullYear()+"年"+(this.getMonth()+1)+"月"+this.getDate()+"日 "+this.getHours()+"时"+this.getMinutes()+"分";
			};
			var d=new Date();
			var str=d.toChinaFormat();
			alert(str);
		</script>
	</head>
	<body>
	</body>
</html>